package org.mm.service.impl;

import org.mm.model.Patient;
import org.mm.repository.PatientRepository;
import org.mm.service.PatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * PatientServiceImpl
 *
 * @author Marco Traversari
 * @version $Revision: $ $Date: $ $Author: $
 */
@Service("patientService")
public class PatientServiceImpl implements PatientService {

	@Autowired
	private PatientRepository patientRepository;

	@Override
	public Patient findById(Long id) throws Exception {
		return patientRepository.findOne(id);
	}

	public Patient findByParentUserId(Long id) throws Exception {
		return patientRepository.findByParentUserId(id);
	}

}
